## Basic Remote Control Concepts

The functionality of the network analyzer's remote control commands has been defined in close analogy to the menu commands and control elements of the graphical user interface (GUI). The basic concepts
of setups, traces, channels, and diagram areas remain valid in remote control. Moreover, all commands follow SCPI syntax rules, and SCPI-confirmed commands have been used whenever possible. These principles largely simplify the development of remote control scripts.

The GUI and the remote control command set both aim at maximum operating convenience. In manual control this generally means that the control elements are easy to find and intuitive to handle, and that the effect of each operation is easy to verify on the screen. Convenient remote control operation depends on a simple and systematic program syntax and on a predictable instrument state; the display of results is secondary.

These differences suggest the peculiarities in the analyzer's remote control concept discussed in the following sections.

### Traces, Channels, and Diagram Areas

Like in manual control, traces can be assigned to a channel and displayed in diagram areas (see Traces, Channels and Diagram Areas
). There are two main differences between manual and remote control:

- A trace can be created without being displayed on the screen.

- A channel must not necessarily contain a trace. Channel and trace configurations are independent of each other.

The following frequently used commands create and delete traces, channels, and diagram areas:

Create new trace and new channel (if channel <Ch> does not exist yet) | CALCulate<Ch>:PARameter:SDEFine '<Trace Name>', '< Meas Parameter>
Delete trace | CALCulate<Ch>:PARameter:DELete <Trace Name>
Create or delete channel | CONFigure:CHANnel<Ch>[:STATe] ON | OFF
Create or delete diagram area | DISPlay:WINDow<Wnd>:STATe ON | OFF
Display trace in diagram area | DISPlay:WINDow<Wnd>:TRACe<WndTr>:FEED

The assignment between traces, channels, and diagram areas is defined via numeric suffixes as illustrated in the following example:

CALC4:PAR:SDEF 'Ch4Tr1', 'S11'

Create channel 4 (channel suffix 4) and a trace named Ch4Tr1 to measure the input reflection coefficient S11. The trace is created but not displayed.

DISP:WIND2:STAT ON

Create diagram area no. 2 (window suffix 2).

DISP:WIND2:TRAC9:FEED 'CH4TR1'

Display the generated trace (identified by its name Ch4Tr1) in diagram area no. 2 (window suffix 2), assigning the trace number 9 (trace suffix 9) to it.

### Active Traces in Remote Control

In manual control there is always exactly one active trace, irrespective of the number of channels and traces defined. The active channel contains the active trace; see Trace Settings
.

In remote control, each channel contains an active trace (unless the channel contains no trace at all), so the notion of active channel is meaningless. This principle actually simplifies the remote control command syntax, because it allows the active trace in a particular channel to be referenced by means of the channel suffix. No additional trace identifier is needed; there is no need either to distinguish channel and trace settings using mnemonics or suffixes.

The active traces are handled as follows:

- After a preset (*RST), the analyzer displays a single diagram area with the default trace no. 1 named TRC1. The trace is active in manual and in remote control.

- In manual control, a new, added trace automatically becomes the active trace. To select another trace as the active trace, click inside the trace list.

- In remote control, a new trace added via CALCulate<Ch>:PARameter:SDEFine '<trace_name>', '<parameter>'
  also becomes the active trace. To select another trace as the active trace, use (CALCulate<Ch>:PARameter:SELect '<trace_name>'
  ).

- The active traces for manual and remote control may be different.

The following program example illustrates how to create, select and reference traces. It is instructive to observe the analyzer screen in order to check the effect of each step.

*RST

Reset the analyzer, creating channel no. 1 with the default trace Trc1. The trace is displayed in diagram area no. 1.

CALC1:PAR:SDEF 'Trc2', 'S11'; DISP:WIND:TRAC2:FEED 'Trc2'

Create a new trace named Trc2, assigned to channel no. 1 (the suffix 1 after CALC, may be omitted), and display the trace. The new trace automatically becomes the active trace for manual and for remote control. To check this, click Trace – Marker – Marker 1 to create a marker. The marker is assigned to Trc2. Delete all markers (Trace – Marker – All Markers Off).

CALC1:MARK ON

To verify that Trc2 is also active for remote control, use the channel suffix 1 after CALC (may be omitted) to reference the active trace in channel 1 and create a marker Mkr 1. The marker is assigned to Trc2.

CALC:PAR:SEL 'Trc1'; CALC1:MARK ON

Select the old default trace Trc1 as the active trace for remote control. Create a new marker to verify that Trc1 is now the active trace in channel 1.

In the SCPI command description, the numeric suffix <Ch> is used for channel settings (it denotes the configured channel), whereas <Chn> is used for trace settings (it denotes the active trace in the channel).

### Initiating Measurements, Speed Considerations

After a reset the network analyzer measures in continuous mode. The displayed trace shows the result of the last sweep and is continuously updated. This provides a permanent visual control over the measurement and the effect of any analyzer settings.

In remote control, it is advisable to follow a different approach in order use the analyzer's resources to full capacity and gain measurement speed. The following principles can help to optimize a remote control program (see also programming example Typical Stages of a Measurement
):

- Switch off the measurement while configuring your instrument.

- Use a minimum number of suitably positioned sweep points.

- Start a single sweep, observing proper command synchronization, and retrieve your results.

The following command sequence performs a single sweep in a single channel.

*RST; INITiate:CONTinous OFF

Activate single sweep mode for all channels (including the channels created later).

INITiate:SCOPe SING

State that a single sweep will be performed in the active channel only.

INITiate[:IMMediate]; *WAI

Start a single sweep in channel no. 2, wait until the sweep is terminated before proceeding to the next command (see Command Synchronization
).